package com.lins.framework.utils.tip;

import android.content.Context;

import com.lins.framework.widget.MyLoadingDialog;

/**
 * Created by Admin on 2017/3/20.
 */

public class LoadingDialogUtil {
    public static MyLoadingDialog loadingDialog;

    /**
     * 弹出进度框
     *
     * @param tip
     * @return
     */
    public static boolean showLoading(Context context, String tip) {
        hideLoading();
        loadingDialog = new MyLoadingDialog(context, tip);
        loadingDialog.show();

        return true;
    }

    /**
     * 设置ProgressDialog 的Message
     *
     * @param tip
     */
    public static void setLoadingMsg(String tip) {
        if (loadingDialog != null)
            loadingDialog.setMessage(tip);
    }

    /**
     * 通知取消提示
     *
     * @return
     */
    public static boolean hideLoading() {
        if (loadingDialog != null)
            loadingDialog.dismiss();
        return true;
    }

}
